package com.njh.kaleidoscope.common.file;

public class PATH {
	
	private static final String SDROOTDIR = "cmofile";
	
	/**
	 * 初始化相关目录
	 */
	public static void init() {
		FILE.getInstance().createDir(getWorkDir());
		FILE.getInstance().createDir(getCacheDir());
		FILE.getInstance().createDir(getDBBackUpDir());
		FILE.getInstance().createDir(getUnzipDir());
		FILE.getInstance().createDir(getImageDir());
		FILE.getInstance().createDir(getSplashImageDir());
		FILE.getInstance().createDir(getDownApkDir());
		FILE.getInstance().createDir(getPluginDir());
		FILE.getInstance().createDir(getUpdateDir());
		FILE.getInstance().createDir(getSerialDataCDir());
		FILE.getInstance().createDir(getCrashLog());
	}
	
	/**
	 * 获取根目录
	 * @return
	 */
	public static String getWorkDir(){
	    return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/";
	}
	
	/**
	 * 图片目录
	 * @return
	 */
	public static String getImageDir(){
	    return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/images/";
	}
	
	/**
	 * 启动图目录
	 * @return
	 */
	public static String getSplashImageDir(){
	    return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/splash/";
	}
	
	/**
	 * 解压缓存目录
	 * @return
	 */
	public static String getUnzipDir() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/unziptmp/";
	}
	
	/**
	 * 缓存目录
	 * @return
	 */
	public static String getCacheDir() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/tmp/";
	}
	
	/**
	 * sd卡中数据库路径
	 * @return
	 */
	public static String getDBBackUpDir() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/backup/";
	}
	
	
	/**
	 * 获取下载apk路径
	 * @return
	 */
	public static String getDownApkDir() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/downapk/";
	}
	
	/**
	 * 获取下载插件路径
	 * @return
	 */
	public static String getPluginDir() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/plugin/";
	}

	/**下载更新包目录*/
	public static String getUpdateDir() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/updateapk/";
	}
	
	/**异常日志目录*/
	public static String getCrashLog() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/crashlog/";
	}

	/**序列化数据保存*/
	public static String getSerialDataCDir() {
		return SDUtils.getInstance().externalMemoryRootPath() + "/" + SDROOTDIR + "/serialdata/";
	}

}
